Version:=3.8
ModuleName:=rp-pppoe
PPPName:=ppp-2.4.4

Objcet:=pppoe.tgz
ObjectDir:=$(ModuleName)-$(Version)/
ObjectSrcDir:=$(ObjectDir)/src/
ObjcetSource:=$(ModuleName)-$(Version).tar.gz

PPPDir:=$(PPPName)
PPPSource:=$(PPPName).tar.gz

INSTALL_DIR:=`pwd`/../../usr/local/
INSTALL_PPPDIR:=`pwd`/../usr/local/

.PHONY:all pppoe clean dist_clean pppd

null:

all:pppoe pppd pppoe.tgz

pppoe:$(ObjcetSource)

pppd:$(PPPSource)
	
pppoe.tgz:
	rm -rf usr
	rm -rf $(PPPDir)
	tar -xzf $(PPPSource)
	cd $(PPPDir) && ./configure --prefix=$(INSTALL_PPPDIR) && $(MAKE) && $(MAKE) install
	
	rm -fr $(ObjectDir)
	tar -xzf $(ObjcetSource)
	cd $(ObjectSrcDir) && ./configure --prefix=$(INSTALL_DIR) && $(MAKE) &&  $(MAKE) install
	
	cd usr/local && rm -fr include man share
	mkdir -p usr/bin
	ln -s /bin/id usr/bin/id
	tar -czf $(Objcet) usr

clean:
	rm -fr $(Objcet) usr


dist_clean: clean
	rm -fr $(ObjectDir) $(ObjcetSource) $(PPPDir) $(PPPSource)

include ../Makefile.Res
